<?php

class info  extends CourseController{
	
	function edit($name) {
		$this->org = $this->orgs->getOrgByName( $name );
		$this->templateVars =  array(
			'title' =>  $this->org[0]['description'] .' - Edit Info - FEELS ',
			'heading' => $this->org[0]['description'],
			'content' => BufferedView::instance('org/forms/info', array(
				'action' => "/org/view/$name/edit-info/submit",
				'hiddenInputs' => array( 'org_id' => $this->org[0]['org_id'] ),
				'info' => $this->org[0]['info'],
				'orgname' => $name,
				'label' => 'Course Information'
			) )->getBuffer(),
			'highlight' => 'orginfo',
			'currentOrg' => $name
		);
	}
	
	function submit($name) {
		$this->orgs->updateOrgInfo( $_POST['org_id'], $_POST['info'] );
		header("Location: /org/view/$name");
	}

		
}
